<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1" />
    <meta name="description" content="" />
    <meta name="author" content="" />
    <!--[if IE]>
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <![endif]-->
    <title>Home</title>
    <!-- BOOTSTRAP CORE STYLE CSS -->
    <link href="css/bootstrap.css" rel="stylesheet" />
    <!-- FONTAWESOME CSS -->
    <link href="css/font-awesome.css" rel="stylesheet" />
    <!-- STYLE SWITCHER CSS -->
    <link href="css/style-switcher.css" rel="stylesheet" />
    <!-- CUSTOM STYLE CSS -->
    <link href="css/style.css" rel="stylesheet" />
    <!-- THEME COLOR STYLE ( DY DEFAULT IT IS HAVING RED COLOR YOUR CAN CHANGE IT BY REPLACEING red.css TO blue.css) -->
    <link id="mainCSS" href="css/themes/red.css" rel="stylesheet" />
</head>
<body>
<div class="switcher" style="left:-95px;">
    <a id="switch-panel" class="hide-panel" style="text-decoration:none;padding-top:-5px;height: 44px">
        <i >></i>
    </a>
    <ul class="colors-list">
        <a style="font-size: 18px;font-weight: bold" href="index.html">个人中心</a>
    </ul>
</div>
<!-- STYLE SWITCHER DIV END-->
<div class="header-section">
    <div class="name-upper">
        <h1 class="name-logo">任务提交</h1>
    </div>
</div>
<!--Main Header Section End-->
<div class="container subscribe-sec">
    <div class="row text-center">
        <div class="col-lg-8 col-md-8 col-sm-8 col-lg-offset-2 col-md-offset-2 col-sm-offset-2 col-xs-12">
            <h1 >未来可期任务平台</h1>
            <hr />
            <h4 >请上传你完成任务的图片</h4>
            <div class="subscribe">
                <div class="input-group">
                    <input id="file_name" type="file" multiple="multiple" class="form-control input-set" accept="image/*" />
                    <span class="input-group-btn">
	                    <button class="btn btn-default btn-set" type="button" onclick="toUp()">上传</button>
                    </span>
                </div>
            </div>
        </div>
    </div>
</div>
<!--About Section End-->
<div class="container contact-sec">
    <div class="row text-center">
        <div class="col-lg-6 col-md-6 col-sm-6 col-lg-offset-3 col-md-offset-3 col-sm-offset-3 col-xs-12">
            <h1 >任务信息</h1>
            <hr />
            <h4 id="finish_time">完成时间：2022-03-29</h4>
            <br />
            <div class="form-group">
                <input type="text" id="task_name" class="form-control" required="required" />
            </div>
            <div class="form-group">
                <input type="text" id="phone" class="form-control" required="required" />
            </div>
            <div class="form-group">
                <textarea name="message" id="message" required="required" class="form-control" style="min-height: 80px;"></textarea>
            </div>
            <div class="form-group">
                <a href="myCenter.html" class="btn btn-info btn-lg btn-block btn-send">确认</a>
            </div>
        </div>
    </div>
</div>
<!--Contact Section End-->
<div id="footer">未来可期有限公司 COPYRIGHT (©) 2022 公司地址：四川省成都市武侯区 联系电话：0021-93123 邮箱：kaix.wang@dhcca.com</a></div>
<!--Footer Section End-->

<!-- CORE SCRIPTS-->
<script src="js/jquery.min.js"></script>
<!-- STYLE SWITCHER SCRIPTS-->
<script src="js/style-switcher.js"></script>
<script>
    let i=1;
    let j=1;
    $(function () {
        let id=window.location.href.split("=")[1];
        let time=new Date();
        $("#finish_time").text(time);
        $.ajax({
            url:"task/param",
            data:{"id":id},
            success:function (res) {
                let data=res.data;
                for (let i = 0; i <data.length ; i++) {
                    $("#task_name").val("任务名称："+data[i].task_name);
                    $("#phone").val("联系电话："+data[i].contact);
                    $("#message").val("任务内容："+data[i].task_content);
                }
            }
        });
    });

    function toUp() {
        let file=$("#file_name")[0].files[0];
        let formData=new FormData();
        formData.append("multipartFile",file);
        console.log(formData);
        $.ajax({
            url:"fileUp",
            cache: false,
            datatype:"json",
            data:{formData,"name":"提交"},
            processData:false,
            contentType:,
            success:function () {
                alert("上传成功，正在审核");
            }
        })
    }

</script>
</body>
</html>
